//
//  KindCell.m
//  ToYourHeartNews
//
//  Created by XJing on 16/1/19.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥. All rights reserved.
//

#import "KindCell.h"

@implementation KindCell
- (void)dealloc
{
    [_picture release];
    [_title release];
    [super dealloc];
}
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.picture = [[UIImageView alloc]init];
        _picture.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_picture];
        [_picture release];
        
        self.title = [[UILabel alloc]init];
//        _title.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:_title];
        [_title release];
    }
    return self;
}
-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super applyLayoutAttributes:layoutAttributes];
    self.backgroundColor = [UIColor whiteColor];
    _picture.frame = CGRectMake(10, 5, self.contentView.frame.size.width - 30, self.contentView.frame.size.width - 30);
    _picture.layer.cornerRadius = (self.contentView.frame.size.width - 30)/ 2;
    _picture.clipsToBounds = YES;
    _title.frame = CGRectMake(self.contentView.frame.size.width / 3, _picture.frame.origin.y + _picture.frame.size.height + 5, self.contentView.frame.size.width / 2, self.contentView.frame.size.width / 6);
    _title.font = [UIFont systemFontOfSize:15];
    _title.textColor = [UIColor grayColor];
}
@end
